package com.asia5b.a5mall.middleware.model.member

import com.asia5b.a5mall.middleware.model.base.BaseModel
import com.asia5b.a5mall.middleware.model.bean.SelectText
import com.asia5b.a5mall.middleware.widget.popup.PopupItemTextInterface
import com.google.gson.annotations.SerializedName

/**
 * Created by zhangyuncai on 2020/1/6.
 */
class CountryAllModel : BaseModel() {
    //国家公馆
    var country_list: List<CountryModel>? = null
    //币种
    var currency_list: List<CurrencyModel>? = null
        get() {
            if (country_list != null) {
                field?.forEach { currencyModel ->
                    for (countryModel in country_list!!) {
                        if (currencyModel.country_id == countryModel.country_id) {
//                            currencyModel.image_link = countryModel.image_link
                        }
                    }
                }
            }
            return field
        }
    //仓库
    var house_list: List<HouseModel>? = null
    //语言
    var language_list: ArrayList<LanuageModel>? = null


}

class LanuageModel: BaseModel() {
    var icon=""

    var languages=""

    var languages_abbreviation=""

}


class HouseModel : BaseModel(), SelectText, PopupItemTextInterface {
    override fun getText(): String {
        return house_name
    }

    val country_id=""

    val formula=""

    val house_add=""

    val house_name=""

    val house_type=""

    val id=0
    val jym=""

    val link_man=""

    val link_tel=""

    val lost_da=""

    val post_code=""

    val sort=0
    val wave_day=""

    val wave_day_money=""

}


class CountryModel : BaseModel() {
    //国家缩写
    @SerializedName(value = "country_abbreviation",alternate = ["country_short"])
    var country_abbreviation = ""

    //国家区号
    @SerializedName(value = "country_code",alternate = ["gr"])
    var country_code = ""

    //国家英文名称
    @SerializedName(value = "country_en_name",alternate = ["en_name"])
    var country_en_name = ""

    //国家id
    var country_id = 0
    //国家名称
    var country_name = ""

    //国家旗帜图片
    @SerializedName(value = "image_link",alternate = ["icon"])
    var image_link = ""

    //is_show是否展示
    var is_show = 0
    //语言名称
    var lang_name = ""


}

/*

{
"language_list": [
{
    "id": 1,
    "languages": "马来语",
    "languages_abbreviation": "ms",
    "state": 0,
    "sorts": 1,
    "icon": "http:\/\/47.88.173.86:82\/wms\/20200520\/202
},
{
    "id": 2,
    "languages": "中文(简体)",
    "languages_abbreviation": "cn",
    "state": 0,
    "sorts": 1,
    "icon": "http:\/\/47.88.173.86:82\/wms\/20200520\/202
},
{
    "id": 3,
    "languages": "英语",
    "languages_abbreviation": "en",
    "state": 0,
    "sorts": 2,
    "icon": "http:\/\/47.88.173.86:82\/wms\/20200613\/202
},
{
    "id": 4,
    "languages": "泰语",
    "languages_abbreviation": "th",
    "state": 0,
    "sorts": 3,
    "icon": "http:\/\/47.88.223.5:5000\/static\/api\/img\
},
{
    "id": 5,
    "languages": "印尼",
    "languages_abbreviation": "id",
    "state": 0,
    "sorts": 4,
    "icon": "http:\/\/47.88.223.5:5000\/static\/api\/img\
},
{
    "id": 15,
    "languages": "越南",
    "languages_abbreviation": "vi",
    "state": 0,
    "sorts": 5,
    "icon": "http:\/\/47.88.173.86:82\/wms\/20200506\/202
},
{
    "id": 16,
    "languages": "菲律宾",
    "languages_abbreviation": "fil",
    "state": 0,
    "sorts": 6,
    "icon": "http:\/\/47.88.223.5:5000\/static\/api\/img\
}
]
"country_list": [
    {
        "country_id": 4,
        "country_name": "马来西亚（Malaysia）",
        "country_abbreviation": "ms",
        "country_en_name": "Malaysia",
        "country_code": "60",
        "lang_name": "Malaysia",
        "is_show": 1,
        "image_link": "http:\/\/47.88.223.5:5000\/static\/api\/img\
    },
    {
        "country_id": 12,
        "country_name": "中国（China）",
        "country_abbreviation": "cn",
        "country_en_name": "China",
        "country_code": "86",
        "lang_name": "China",
        "is_show": 1,
        "image_link": "http:\/\/47.88.223.5:5000\/static\/api\/img\
    },
    {
        "country_id": 98,
        "country_name": "印度尼西亚（Indonesia）",
        "country_abbreviation": "id",
        "country_en_name": "Indonesia",
        "country_code": "62",
        "lang_name": "Indonesia",
        "is_show": 1,
        "image_link": "http:\/\/47.88.223.5:5000\/static\/api\/img\
    },
    {
        "country_id": 99,
        "country_name": "泰国（Thailand）",
        "country_abbreviation": "th",
        "country_en_name": "Thailand",
        "country_code": "66",
        "lang_name": "Thailand",
        "is_show": 1,
        "image_link": "http:\/\/47.88.223.5:5000\/static\/api\/img\
    },
    {
        "country_id": 100,
        "country_name": "越南(Vietnam)",
        "country_abbreviation": "vi",
        "country_en_name": "Vietnam",
        "country_code": "84",
        "lang_name": "Vietnam",
        "is_show": 1,
        "image_link": "http:\/\/47.88.223.5:5000\/static\/api\/img\
    },
    {
        "country_id": 101,
        "country_name": "菲律宾(Philippines)",
        "country_abbreviation": "fil",
        "country_en_name": "Philippines",
        "country_code": "63",
        "lang_name": "Philippines",
        "is_show": 1,
        "image_link": "http:\/\/47.88.223.5:5000\/static\/api\/img\
    }
],
"house_list": [
    {
        "id": 3,
        "house_name": "槟城仓",
        "country_id": "4",
        "house_type": "仓库",
        "link_tel": "321654987123",
        "link_man": "李四",
        "post_code": "765431",
        "house_add": "槟城仓库",
        "wave_day": null,
        "wave_day_money": null,
        "lost_day": null,
        "jym": "88",
        "sort": 1,
        "formula": ""
    },
    {
        "id": 5,
        "house_name": "吉隆坡仓",
        "country_id": "4",
        "house_type": "仓库",
        "link_tel": "265419784532",
        "link_man": "王五",
        "post_code": "543216",
        "house_add": "吉隆坡仓库",
        "wave_day": null,
        "wave_day_money": null,
        "lost_day": null,
        "jym": "",
        "sort": 3,
        "formula": ""
    },
    {
        "id": 8,
        "house_name": "吉打仓",
        "country_id": "4",
        "house_type": "仓库",
        "link_tel": "265498781231",
        "link_man": "赵六",
        "post_code": "432156",
        "house_add": "吉打仓库",
        "wave_day": null,
        "wave_day_money": null,
        "lost_day": null,
        "jym": "",
        "sort": 4,
        "formula": ""
    },
    {
        "id": 11,
        "house_name": "义乌仓",
        "country_id": "12",
        "house_type": "仓库",
        "link_tel": "15987536987",
        "link_man": "哆啦A梦",
        "post_code": "000000",
        "house_add": "义乌仓库",
        "wave_day": null,
        "wave_day_money": null,
        "lost_day": null,
        "jym": "",
        "sort": 5,
        "formula": ""
    }
],
"currency_list": [
    {
        "currency_id": 2,
        "currency_name": "马币",
        "currency_short": "myr",
        "country_id": 4,
        "currency_mark": "RM"
    },
    {
        "currency_id": 7,
        "currency_name": "人民币",
        "currency_short": "rmb",
        "country_id": 12,
        "currency_mark": "RMB"
    }
]
}
 */
